<template>
   <div>
	 <van-nav-bar
	   
	   left-text=""
	   
	   left-arrow
	   @click-left="onClickLeft" 
	 />	
	 <h2>用户注册</h2>  
	 
	 <div class="bos">
	   <van-field
	     v-model="username"
	    
	     clearable
	   	left-icon='manager'
	     label="手机号" 
	     placeholder="输入手机号"
	     @click-right-icon="$toast('question')"
	   />
	   <van-cell-group>
  <van-field
    v-model="Code"
    center
    clearable
    label="短信验证码"
    placeholder="请输入短信验证码"
  >
  <van-button slot="button" size="small" type="primary" @click='yan()'>发送验证码</van-button>
  </van-field>
</van-cell-group>

	<van-field
	  v-model="password"
		left-icon='lock'
	  type="password"
	  
	  placeholder="请输入密码"
	/>   
	   
	 <van-field
	   v-model="passwords"
	 	left-icon='lock'
	   type="passwords"
	 
	   placeholder="请再次输入密码"
	 />  
	 
	 </div>
	 
	   <div class="btn">
	   <van-button plain round size='large' @click='tap()'>注册</van-button>
	   </div>
	   
	   
   </div>
</template>

<script>
	import axios from 'axios'
	import { Toast } from 'vant';
	export default{
		name:'zhuce',
		data(){
			return{		
			username:'15738716549',
			   Code:'11',
				password:'',
				passwords:''
			
			}
		},
		methods:{
			  onClickLeft(){
				 
				 this.$router.go(-1)
			  },
			  tap(){
				  
				axios({
					method:'post',
					url:"http://w34uc5.natappfree.cc/secondHand/user/userAdd",
					params:{userPhone:this.username,userPassword:this.password,userCode:this.Code}
				}).then((data)=>{
					console.log(data.data.data)
				})
			},
			yan(){
				  // axios({
					 //  url:"http://w34uc5.natappfree.cc/secondHand/user/userCodeCheck",
					 // params:{userCode:this.Code,userPhone:this.username}
				  // }).then((data)=>{
					 //  console.log(data.data.data)
				  // })
			  }
	},
	}
</script>

<style>
	h2{
		text-align: center;
	}
	.btn{
		width:150px;
		height:30px;
		margin-top: 100px;
		margin-left: 30%;
	}
	.bos{
		margin-top: 100px;
	}
</style>
